NetworkModule

public class NetworkModule

This object acts as a data module for the Network's services.

Functions

addCertificateSHA
Link copied to clipboard
final Unit addCertificateSHA(OkHttpClient.Builder httpClient)
This method adds the CertificatePinner.Builder to the passing OkHttpClient.Builder.
createRetrofit
Link copied to clipboard
final Retrofit createRetrofit(Lazy<OkHttpClient> okHttpClient)
This method creates the Retrofit instance for the passing Lazy of OkHttpClient type.
getHttpClient
Link copied to clipboard
final OkHttpClient.Builder getHttpClient(Cache cache)
This method gets the OkHttpClient.Builder instance for the passing Cache.
provideApiService
Link copied to clipboard
@Singleton()
@Provides()
final ApiService provideApiService(Retrofit retrofit)
This method provides the ApiService instance for the passing Retrofit.
provideCache
Link copied to clipboard
@Singleton()
@Provides()
final Cache provideCache(Context context)
This method provides the Cache instance for the passing Context.
provideOkhttpClient
Link copied to clipboard
@Singleton()
@Provides()
final OkHttpClient provideOkhttpClient(Cache cache)
This method provides the OkHttpClient instance for the passing Cache.
provideRetrofit
Link copied to clipboard
@Singleton()
@Provides()
final Retrofit provideRetrofit(Lazy<OkHttpClient> okHttpClient)
This method provides the Retrofit instance for the passing Lazy of OkHttpClient type.

Properties

INSTANCE
Link copied to clipboard
public final static NetworkModule INSTANCE